package com.toptech.downloadmanager;

/**
 * Created by zhengshaorui on 2017/3/21.
 */

public class Taskinfo {
    private String name;
    private String url;
    private int threadcount;


    public Taskinfo(Builder builder) {
        this.name = builder.name;
        this.url = builder.url;
        this.threadcount = builder.threadcount;
    }

    public static class Builder{
        private String name;
        private String url;
        private int threadcount;

        public Builder setName(String name){
            this.name = name;
            return this;
        }

        public Builder setUrl(String url){
            this.url = url;
            return this;
        }
        public Builder setThreadcount(int threadcount){
            this.threadcount = threadcount;
            return this;
        }

        public Taskinfo build(){
           return new Taskinfo(this);
        }
    }

    @Override
    public String toString() {
        return "Taskinfo{" +
                "name='" + name + '\'' +
                ", url='" + url + '\'' +
                ", threadcount=" + threadcount +
                '}';
    }
}
